package open.panxiong.shared.activity.router

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.imePadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import open.panxiong.shared.activity.screen.MainScreen
import open.panxiong.shared.activity.theme.AndShareTheme

/**
 * 构建路由
 */
@Preview(showBackground = true)
@Composable
fun RootComposable() {
    val navController = rememberNavController()

    AndShareTheme {
        NavHost(
            navController = navController,
            startDestination = "main",
            modifier = Modifier
                .fillMaxSize()
                .imePadding()
        ) {
            composable("main") { stack ->
                MainScreen(stack)
            }
        }
    }
}